/**
 * @Description:
 * @date: 2024/5/29 14:03
 * @author: wujun83
 * @email: wujun83@wanda.cn
 * @version: V1.0
 */

import web_webview from '@ohos.web.webview'
import { Bridge, BridgeHelper, BridgeRequest, Handler } from '@alvin917/jsbridge'

@Bridge
export class WebInnerBridge {
    @Handler()
    submitFromWeb22(controller: web_webview.WebviewController, request: BridgeRequest) {
        console.log(`WebInnerBridge submitFromWeb22: ${JSON.stringify(request.data)}`)
        try {
            let obj = JSON.parse(request.data)
            console.log(`WebInnerBridge submitFromWeb22: ${obj['title']}`)
            BridgeHelper.sendResponse(request.callbackId, { status: 'success' });
        } catch (e) {
            console.log(JSON.stringify(e))
        }
    }
}

